#ifndef _FRUIT_HPP
#define _FRUIT_HPP

#include "world.hpp"
#include "FruitSaladAi.hpp"
#include "task.h"


#define ROLE_TANK
#define ROLE_DPS
#define ROLE_HEAL
#define ROLE_PEON


class Fruit {

    public:
    unsigned int id;
    bool gentle;           //Si true, alors ce fruit nous appartient.
    map_chunk* position;
    unsigned int type;
    map<int, Object> items;

    unsigned int age;

    unsigned int role;
    Task *task;
    unsigned int behaviour;

    unsigned int actionsRestantes;

    int life;
    int defense;
    int force;
    int range;
    int ammo;
    int capacity;
    int load;
    int sugar;
    int vitamins;
    int speed;

    int maxLife;
    int maxDefense;
    int maxAmmo;
    int sugarWallet;
    int vitaminsWallet;
    int counterAction;

    unsigned short arme;
    unsigned short arme_degats;
    unsigned short arme_munitions;
    unsigned short arme_portee;

    //int oldPosX, oldPosY;

    int getId();
    bool passedBy();
    int getType();
    int getAge();

/*    int getPVPortes();
    int getSucrePorte();
    void getPVPortes(int PV);
    void getSucrePorte(int sucre);*/

    int getMaxMove();

    int getTaper();
    int getAmmo();
    int getReach();

    /*int getSupposedDamage();
    int getSupposedReach();
    int getSupposedDefense();
    void alterDefense(int modify);*/

    int getRole();
    int getBehaviour();
    void setBehaviour(int behave);

    //Renvoie l'id de la meilleur arme de corps à corps en notre possession, -1 si on n'en a pas
    int getMeilleureArmeCAC();

    int getPosX();
    int getPosY();

   // void actualPos(int x, int y);

    //Initialisation, est appelée après avoir défini le type de fruit
    void init();

    void updateLoad();

    int move (int destX, int destY);
    int attack(int targetId);
    int useEquipment(int equipmentId, int targetId);
    int pickUpEquipment(int equipmentId);
    int dropEquipment(int equipmentId, int x, int y);
    int pickUpSugar(int sugarDropId);
    int dropSugar(int quantity, int x, int y);
    int openChest(int chestId);
    int stockSugar();
    int sellEquipment(int equipmentId);
    int buyEquipment(int equimentType);
    int drinkJuice();
    int drawVitamin();

    Fruit();
    ~Fruit();
};

#endif
